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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: B = None
        self.v: D = None
        self.s: D = None
        self.w: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: B = None
        self.v: D = None
        self.s: D = None
        self.w: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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