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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: B = None
        self.p: B = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.p: E = None
        self.w: C = None
        self.t: A = None
        self.txt = txt

f = A("f")
n = B("n")
m = C("m")
g = D("g")
l = E("l")
d = F("d")
b = E("b")

f.u = n
f.z = d
f.o = d
f.p = b
n.r = d
n.z = f
n.y = l
m.x = n
m.u = f
m.w = g
g.s = b
g.w = n
g.p = n
g.q = f
l.z = d
l.u = m
d.v = f
d.t = f
d.y = m
d.w = m
d.p = l
b.z = d
b.u = m
assert b.z.y.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: F = None
        self.o: F = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: B = None
        self.p: B = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.p: E = None
        self.w: C = None
        self.t: A = None
        self.txt = txt

f = A("f")
n = B("n")
m = C("m")
g = D("g")
l = E("l")
d = F("d")
b = E("b")

f.u = n
f.z = d
f.o = d
f.p = b
n.r = d
n.z = f
n.y = l
m.x = n
m.u = f
m.w = g
g.s = b
g.w = n
g.p = n
g.q = f
l.z = d
l.u = m
d.v = f
d.t = f
d.y = m
d.w = m
d.p = l
b.z = d
b.u = m
assert b.z.y.w.q.txt == "f"