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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: D = None
        self.u: C = None
        self.r: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: D = None
        self.u: C = None
        self.r: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

f.r = j
f.t = m
h.w = j
h.t = j
h.u = b
h.r = m
h.q = f
b.o = k
j.x = k
j.r = k
j.w = b
j.y = b
j.v = b
j.z = m
m.t = k
m.w = b
k.u = h
k.v = b
assert b.o.v.o.u.u.o.txt == "k"