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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: A = None
        self.q: A = None
        self.w: D = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: F = None
        self.r: A = None
        self.p: E = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: C = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

m = A("m")
j = B("j")
e = C("e")
l = D("l")
d = E("d")
c = F("c")
n = E("n")
a = D("a")

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: A = None
        self.q: A = None
        self.w: D = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: F = None
        self.r: A = None
        self.p: E = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: C = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

m = A("m")
j = B("j")
e = C("e")
l = D("l")
d = E("d")
c = F("c")
n = E("n")
a = D("a")

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