class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.x: A = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

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

b.w = d
b.o = d
b.s = d
b.y = d
b.x = j
d.y = m
h.w = n
h.v = d
a.u = b
a.v = n
m.q = j
m.z = j
k.r = h
k.s = a
e.q = b
e.z = b
n.w = h
n.v = d
j.w = d
j.o = d
j.s = d
j.y = d
j.x = b
assert a.u.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.x: A = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

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

b.w = d
b.o = d
b.s = d
b.y = d
b.x = j
d.y = m
h.w = n
h.v = d
a.u = b
a.v = n
m.q = j
m.z = j
k.r = h
k.s = a
e.q = b
e.z = b
n.w = h
n.v = d
j.w = d
j.o = d
j.s = d
j.y = d
j.x = b
assert a.u.s.y.txt == "m"