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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.q: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: A = None
        self.txt = txt

b = A("b")
j = B("j")
h = C("h")
c = D("c")
d = E("d")
k = F("k")
e = C("e")
m = E("m")

b.u = c
b.y = c
j.x = e
j.p = k
j.q = m
h.r = e
h.t = k
h.y = b
c.w = j
c.t = j
c.u = d
d.t = h
d.y = h
d.u = b
d.z = j
k.t = m
k.s = b
e.r = h
e.t = k
e.y = b
m.t = e
m.u = b
m.z = j
m.y = h
assert c.u.z.q.t.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.q: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: A = None
        self.txt = txt

b = A("b")
j = B("j")
h = C("h")
c = D("c")
d = E("d")
k = F("k")
e = C("e")
m = E("m")

b.u = c
b.y = c
j.x = e
j.p = k
j.q = m
h.r = e
h.t = k
h.y = b
c.w = j
c.t = j
c.u = d
d.t = h
d.y = h
d.u = b
d.z = j
k.t = m
k.s = b
e.r = h
e.t = k
e.y = b
m.t = e
m.u = b
m.z = j
m.y = h
assert c.u.z.q.t.y.y.txt == "c"