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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.r: E = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

b = A("b")
c = B("c")
h = C("h")
g = D("g")
i = E("i")
j = F("j")
f = E("f")

b.v = j
b.y = j
b.w = h
b.z = i
c.p = j
c.o = b
h.o = g
h.p = g
h.r = i
h.q = i
g.r = c
i.q = b
i.y = b
i.v = c
i.t = c
i.p = h
i.w = j
j.u = f
j.o = h
f.q = b
f.y = b
f.v = c
f.t = c
f.p = h
f.w = j
assert b.v.u.v.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: C = None
        self.z: E = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.r: E = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

b = A("b")
c = B("c")
h = C("h")
g = D("g")
i = E("i")
j = F("j")
f = E("f")

b.v = j
b.y = j
b.w = h
b.z = i
c.p = j
c.o = b
h.o = g
h.p = g
h.r = i
h.q = i
g.r = c
i.q = b
i.y = b
i.v = c
i.t = c
i.p = h
i.w = j
j.u = f
j.o = h
f.q = b
f.y = b
f.v = c
f.t = c
f.p = h
f.w = j
assert b.v.u.v.p.o.txt == "h"