class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

l.t = n
f.t = n
n.o = d
n.s = i
i.z = n
i.t = n
i.o = f
d.v = i
d.p = l
d.u = l
d.y = b
j.x = d
j.z = l
c.s = j
b.x = d
b.z = l
g.t = n
assert b.x.v.o.t.s.o.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

l.t = n
f.t = n
n.o = d
n.s = i
i.z = n
i.t = n
i.o = f
d.v = i
d.p = l
d.u = l
d.y = b
j.x = d
j.z = l
c.s = j
b.x = d
b.z = l
g.t = n
assert b.x.v.o.t.s.o.t.s.txt == "i"