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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.z: D = None
        self.w: E = None
        self.v: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.z: D = None
        self.w: E = None
        self.v: A = None
        self.r: E = None
        self.txt = txt

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

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

l.z = m
f.t = n
m.y = f
m.p = c
j.r = i
j.u = n
n.x = m
n.s = j
n.r = j
n.u = j
i.y = c
i.o = c
i.z = j
i.w = n
i.r = n
i.v = l
c.t = i
c.z = j
c.y = n
c.v = n
assert f.t.x.y.t.txt == "n"