class A:
    def __init__(self, txt: str):
        self.u: D = 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.s: A = None
        self.y: F = None
        self.x: C = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

k.u = f
j.y = c
h.s = k
h.y = n
h.x = a
h.p = j
h.w = f
f.v = n
f.p = m
f.y = m
f.z = e
f.u = e
f.r = b
c.w = f
c.z = b
c.o = m
c.r = m
c.x = m
c.y = m
n.s = e
n.p = e
n.x = f
m.w = f
m.z = b
m.o = c
m.r = c
m.x = c
m.y = c
e.s = n
e.p = n
e.x = f
b.u = f
a.s = k
a.y = e
a.x = h
a.p = j
a.w = f
assert m.w.r.u.v.p.x.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = 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.s: A = None
        self.y: F = None
        self.x: C = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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