class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: A = None
        self.txt = txt

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

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

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

i.v = j
i.q = j
j.u = d
j.x = b
j.o = f
f.w = b
f.o = i
f.r = k
g.s = i
g.u = i
b.s = f
b.q = f
b.y = k
b.v = g
b.z = d
b.u = h
h.v = k
d.u = j
d.x = b
d.o = f
k.s = i
k.u = i
assert f.r.u.v.u.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: A = None
        self.txt = txt

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

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

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

i.v = j
i.q = j
j.u = d
j.x = b
j.o = f
f.w = b
f.o = i
f.r = k
g.s = i
g.u = i
b.s = f
b.q = f
b.y = k
b.v = g
b.z = d
b.u = h
h.v = k
d.u = j
d.x = b
d.o = f
k.s = i
k.u = i
assert f.r.u.v.u.x.u.txt == "h"