class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: B = None
        self.u: G = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: E = None
        self.o: B = None
        self.t: G = None
        self.p: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: H = None
        self.t: C = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: H = None
        self.q: E = None
        self.o: H = None
        self.u: E = None
        self.x: H = None
        self.y: A = None
        self.txt = txt

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

k = A("k")
e = B("e")
g = C("g")
a = D("a")
f = E("f")
d = F("d")
n = G("n")
b = H("b")

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: E = None
        self.o: B = None
        self.t: G = None
        self.p: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: H = None
        self.t: C = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: H = None
        self.q: E = None
        self.o: H = None
        self.u: E = None
        self.x: H = None
        self.y: A = None
        self.txt = txt

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

k = A("k")
e = B("e")
g = C("g")
a = D("a")
f = E("f")
d = F("d")
n = G("n")
b = H("b")

k.x = f
k.z = e
k.t = e
k.u = n
e.v = a
e.q = a
e.z = b
e.r = b
e.y = g
g.q = k
g.s = f
g.o = e
g.t = n
g.r = n
g.p = a
a.x = d
a.r = b
a.q = b
a.t = g
f.t = g
f.q = g
f.y = g
d.t = g
n.p = e
n.w = b
n.o = b
n.x = b
n.q = f
n.u = f
n.y = k
b.x = f
b.p = f
b.q = g
b.t = n
assert d.t.r.p.r.q.txt == "g"