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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

l = A("l")
a = B("a")
d = C("d")
m = D("m")
k = E("k")
f = F("f")
c = G("c")

l.p = d
l.o = k
l.t = m
a.q = d
d.t = c
d.v = c
m.s = l
m.y = a
m.v = a
m.o = f
m.p = c
m.t = k
k.z = d
k.t = d
k.v = c
k.p = c
k.s = a
k.w = m
f.z = a
c.z = a
c.x = k
c.p = m
assert c.x.s.q.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

l = A("l")
a = B("a")
d = C("d")
m = D("m")
k = E("k")
f = F("f")
c = G("c")

l.p = d
l.o = k
l.t = m
a.q = d
d.t = c
d.v = c
m.s = l
m.y = a
m.v = a
m.o = f
m.p = c
m.t = k
k.z = d
k.t = d
k.v = c
k.p = c
k.s = a
k.w = m
f.z = a
c.z = a
c.x = k
c.p = m
assert c.x.s.q.t.z.txt == "a"