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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = 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.z: G = None
        self.y: B = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.p: E = None
        self.txt = txt

b = A("b")
l = B("l")
i = C("i")
k = D("k")
d = E("d")
j = F("j")
n = G("n")
g = D("g")

b.t = j
b.y = d
l.s = i
l.o = k
i.o = j
k.z = n
k.y = l
k.w = i
k.p = i
d.r = n
d.x = n
d.p = n
d.o = i
j.o = i
n.z = j
n.t = g
n.p = d
g.z = n
g.y = l
g.w = i
g.p = i
assert d.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = 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.z: G = None
        self.y: B = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.p: E = None
        self.txt = txt

b = A("b")
l = B("l")
i = C("i")
k = D("k")
d = E("d")
j = F("j")
n = G("n")
g = D("g")

b.t = j
b.y = d
l.s = i
l.o = k
i.o = j
k.z = n
k.y = l
k.w = i
k.p = i
d.r = n
d.x = n
d.p = n
d.o = i
j.o = i
n.z = j
n.t = g
n.p = d
g.z = n
g.y = l
g.w = i
g.p = i
assert d.o.o.o.o.txt == "j"