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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.v: E = None
        self.o: E = None
        self.y: E = None
        self.t: F = None
        self.txt = txt

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

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

h = A("h")
e = B("e")
d = C("d")
c = D("c")
m = E("m")
n = F("n")
f = E("f")

h.w = c
e.q = m
e.z = c
e.v = c
e.u = n
e.s = n
e.y = h
d.w = e
d.t = c
c.u = e
c.q = d
c.v = f
c.y = f
c.o = m
c.t = n
m.s = d
m.o = n
m.r = f
m.z = f
n.y = e
n.p = e
n.z = h
n.o = h
n.s = d
f.s = d
f.o = n
f.r = m
f.z = m
assert e.y.w.q.w.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.v: E = None
        self.o: E = None
        self.y: E = None
        self.t: F = None
        self.txt = txt

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

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

h = A("h")
e = B("e")
d = C("d")
c = D("c")
m = E("m")
n = F("n")
f = E("f")

h.w = c
e.q = m
e.z = c
e.v = c
e.u = n
e.s = n
e.y = h
d.w = e
d.t = c
c.u = e
c.q = d
c.v = f
c.y = f
c.o = m
c.t = n
m.s = d
m.o = n
m.r = f
m.z = f
n.y = e
n.p = e
n.z = h
n.o = h
n.s = d
f.s = d
f.o = n
f.r = m
f.z = m
assert e.y.w.q.w.u.z.txt == "h"