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

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

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

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

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

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

a = A("a")
h = B("h")
j = C("j")
i = D("i")
f = E("f")
d = F("d")
m = B("m")
n = D("n")

a.v = d
h.o = j
h.x = a
h.w = m
h.u = d
h.p = f
j.t = h
j.s = n
j.u = a
j.z = f
j.x = f
j.p = f
i.q = n
i.u = f
f.w = n
f.q = i
f.t = h
d.y = a
m.o = j
m.x = a
m.w = h
m.u = d
m.p = f
n.q = i
n.u = f
assert a.v.y.v.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

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

a = A("a")
h = B("h")
j = C("j")
i = D("i")
f = E("f")
d = F("d")
m = B("m")
n = D("n")

a.v = d
h.o = j
h.x = a
h.w = m
h.u = d
h.p = f
j.t = h
j.s = n
j.u = a
j.z = f
j.x = f
j.p = f
i.q = n
i.u = f
f.w = n
f.q = i
f.t = h
d.y = a
m.o = j
m.x = a
m.w = h
m.u = d
m.p = f
n.q = i
n.u = f
assert a.v.y.v.y.v.txt == "d"