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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: E = None
        self.v: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: E = None
        self.v: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

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

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