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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: A = None
        self.w: F = None
        self.u: B = None
        self.z: F = None
        self.x: A = None
        self.txt = txt

a = A("a")
f = B("f")
k = C("k")
l = D("l")
b = E("b")
g = F("g")
e = G("e")
d = A("d")
j = C("j")

a.v = f
f.u = l
k.z = j
k.s = l
k.u = f
k.x = f
k.p = f
k.o = a
k.w = g
l.z = g
l.t = g
l.p = f
l.s = j
b.w = f
b.s = l
g.p = l
e.s = b
e.q = d
e.x = d
e.w = g
e.z = g
e.u = f
d.v = f
j.z = k
j.s = l
j.u = f
j.x = f
j.p = f
j.o = d
j.w = g
assert l.p.u.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: A = None
        self.w: F = None
        self.u: B = None
        self.z: F = None
        self.x: A = None
        self.txt = txt

a = A("a")
f = B("f")
k = C("k")
l = D("l")
b = E("b")
g = F("g")
e = G("e")
d = A("d")
j = C("j")

a.v = f
f.u = l
k.z = j
k.s = l
k.u = f
k.x = f
k.p = f
k.o = a
k.w = g
l.z = g
l.t = g
l.p = f
l.s = j
b.w = f
b.s = l
g.p = l
e.s = b
e.q = d
e.x = d
e.w = g
e.z = g
e.u = f
d.v = f
j.z = k
j.s = l
j.u = f
j.x = f
j.p = f
j.o = d
j.w = g
assert l.p.u.t.p.txt == "l"