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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

b = A("b")
j = B("j")
c = C("c")
d = D("d")
a = E("a")
n = F("n")
e = G("e")
l = A("l")

b.t = c
b.v = l
b.q = n
j.y = d
j.q = e
c.o = a
c.r = a
c.w = a
c.p = d
c.x = e
d.q = n
d.o = c
d.s = a
d.x = l
a.v = n
n.z = b
e.p = d
e.q = n
e.r = c
l.t = c
l.v = b
l.q = n
assert l.v.t.p.q.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: A = None
        self.q: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

b = A("b")
j = B("j")
c = C("c")
d = D("d")
a = E("a")
n = F("n")
e = G("e")
l = A("l")

b.t = c
b.v = l
b.q = n
j.y = d
j.q = e
c.o = a
c.r = a
c.w = a
c.p = d
c.x = e
d.q = n
d.o = c
d.s = a
d.x = l
a.v = n
n.z = b
e.p = d
e.q = n
e.r = c
l.t = c
l.v = b
l.q = n
assert l.v.t.p.q.z.v.txt == "l"