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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: D = None
        self.p: D = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: D = None
        self.u: D = None
        self.o: C = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: D = None
        self.p: D = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: D = None
        self.u: D = None
        self.o: C = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

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

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