class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: A = None
        self.r: C = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: H = None
        self.s: B = None
        self.o: B = None
        self.x: H = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: H = None
        self.s: C = None
        self.y: G = None
        self.q: A = None
        self.t: C = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: A = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: G = None
        self.p: F = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: C = None
        self.txt = txt

i = A("i")
l = B("l")
a = C("a")
d = D("d")
f = E("f")
g = F("g")
e = G("e")
b = H("b")
c = G("c")
m = B("m")

i.x = c
i.p = e
l.z = f
l.o = f
l.s = i
l.w = i
l.r = a
a.p = b
a.t = b
a.x = b
a.s = l
a.o = m
a.u = f
d.z = m
d.x = b
d.s = a
d.t = a
d.y = c
d.r = c
d.q = i
f.r = m
g.z = b
g.q = i
g.o = e
e.s = g
e.p = g
e.u = c
e.o = a
b.v = e
b.x = a
c.s = g
c.p = g
c.u = e
c.o = a
m.z = f
m.o = f
m.s = i
m.w = i
m.r = a
assert g.z.v.u.o.x.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: A = None
        self.r: C = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: H = None
        self.s: B = None
        self.o: B = None
        self.x: H = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: H = None
        self.s: C = None
        self.y: G = None
        self.q: A = None
        self.t: C = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: A = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: G = None
        self.p: F = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: C = None
        self.txt = txt

i = A("i")
l = B("l")
a = C("a")
d = D("d")
f = E("f")
g = F("g")
e = G("e")
b = H("b")
c = G("c")
m = B("m")

i.x = c
i.p = e
l.z = f
l.o = f
l.s = i
l.w = i
l.r = a
a.p = b
a.t = b
a.x = b
a.s = l
a.o = m
a.u = f
d.z = m
d.x = b
d.s = a
d.t = a
d.y = c
d.r = c
d.q = i
f.r = m
g.z = b
g.q = i
g.o = e
e.s = g
e.p = g
e.u = c
e.o = a
b.v = e
b.x = a
c.s = g
c.p = g
c.u = e
c.o = a
m.z = f
m.o = f
m.s = i
m.w = i
m.r = a
assert g.z.v.u.o.x.x.u.txt == "f"