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

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

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

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

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

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

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

f.x = d
f.w = j
f.r = n
b.t = h
b.s = h
b.v = k
b.z = j
b.u = n
b.x = n
k.z = f
k.y = b
d.v = c
d.u = c
d.o = n
j.z = d
n.u = h
n.z = h
n.r = d
n.x = f
n.v = j
h.t = b
h.s = b
h.v = k
h.z = j
h.u = n
h.x = n
c.v = d
c.u = d
c.o = n
assert b.u.r.o.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

f.x = d
f.w = j
f.r = n
b.t = h
b.s = h
b.v = k
b.z = j
b.u = n
b.x = n
k.z = f
k.y = b
d.v = c
d.u = c
d.o = n
j.z = d
n.u = h
n.z = h
n.r = d
n.x = f
n.v = j
h.t = b
h.s = b
h.v = k
h.z = j
h.u = n
h.x = n
c.v = d
c.u = d
c.o = n
assert b.u.r.o.z.x.txt == "n"