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

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

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

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

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

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

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

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

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

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

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

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

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

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

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