class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: E = None
        self.q: F = None
        self.v: D = None
        self.t: D = None
        self.x: D = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: A = None
        self.p: G = None
        self.o: F = None
        self.y: E = None
        self.u: E = None
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: F = None
        self.z: E = None
        self.t: B = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: D = None
        self.o: B = None
        self.r: D = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: D = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

c = A("c")
a = B("a")
g = C("g")
m = D("m")
j = E("j")
d = F("d")
l = G("l")
n = H("n")
k = C("k")
b = E("b")

c.z = d
c.q = d
c.u = b
c.v = m
c.t = m
c.x = m
c.o = n
a.r = d
a.o = d
a.q = c
a.p = l
a.y = b
a.u = b
a.t = b
a.x = k
g.s = d
m.y = d
m.v = d
m.z = j
m.t = a
m.s = a
m.q = k
j.t = n
j.p = c
j.s = c
j.y = l
j.x = g
j.o = g
d.q = l
d.x = m
l.z = n
l.v = m
l.r = m
l.o = a
l.q = c
n.t = g
n.v = m
n.r = c
n.p = a
k.s = d
b.t = n
b.p = c
b.s = c
b.y = l
b.x = k
b.o = g
assert a.o.q.q.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: E = None
        self.q: F = None
        self.v: D = None
        self.t: D = None
        self.x: D = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: A = None
        self.p: G = None
        self.o: F = None
        self.y: E = None
        self.u: E = None
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: F = None
        self.z: E = None
        self.t: B = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: D = None
        self.o: B = None
        self.r: D = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: D = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

c = A("c")
a = B("a")
g = C("g")
m = D("m")
j = E("j")
d = F("d")
l = G("l")
n = H("n")
k = C("k")
b = E("b")

c.z = d
c.q = d
c.u = b
c.v = m
c.t = m
c.x = m
c.o = n
a.r = d
a.o = d
a.q = c
a.p = l
a.y = b
a.u = b
a.t = b
a.x = k
g.s = d
m.y = d
m.v = d
m.z = j
m.t = a
m.s = a
m.q = k
j.t = n
j.p = c
j.s = c
j.y = l
j.x = g
j.o = g
d.q = l
d.x = m
l.z = n
l.v = m
l.r = m
l.o = a
l.q = c
n.t = g
n.v = m
n.r = c
n.p = a
k.s = d
b.t = n
b.p = c
b.s = c
b.y = l
b.x = k
b.o = g
assert a.o.q.q.u.o.txt == "g"