class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

d.y = n
d.x = a
k.r = b
a.y = d
a.v = d
a.q = d
a.r = e
a.o = m
a.t = b
n.u = k
n.z = k
l.y = b
m.t = k
b.w = l
b.x = l
b.p = l
b.u = k
b.v = n
e.y = d
e.v = d
e.q = d
e.r = a
e.o = m
e.t = b
assert l.y.w.y.v.z.txt == "k"