class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: E = None
        self.p: B = None
        self.y: C = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.z: D = None
        self.y: G = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.z: D = None
        self.y: G = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

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