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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

h = A("h")
e = B("e")
g = C("g")
c = D("c")
b = E("b")
m = F("m")
l = B("l")
n = F("n")

h.r = b
h.z = b
h.u = n
e.z = c
e.w = c
e.u = b
e.s = n
e.t = n
g.p = c
c.t = h
b.t = c
m.z = c
m.u = c
m.s = l
m.y = g
m.o = h
l.z = c
l.w = c
l.u = b
l.s = n
l.t = n
n.z = c
n.u = c
n.s = l
n.y = g
n.o = h
assert e.w.t.z.t.t.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: F = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

h = A("h")
e = B("e")
g = C("g")
c = D("c")
b = E("b")
m = F("m")
l = B("l")
n = F("n")

h.r = b
h.z = b
h.u = n
e.z = c
e.w = c
e.u = b
e.s = n
e.t = n
g.p = c
c.t = h
b.t = c
m.z = c
m.u = c
m.s = l
m.y = g
m.o = h
l.z = c
l.w = c
l.u = b
l.s = n
l.t = n
n.z = c
n.u = c
n.s = l
n.y = g
n.o = h
assert e.w.t.z.t.t.r.t.txt == "c"