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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.x: B = None
        self.r: F = None
        self.p: F = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.y: C = None
        self.z: B = None
        self.r: D = None
        self.v: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.x: B = None
        self.r: F = None
        self.p: F = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.y: C = None
        self.z: B = None
        self.r: D = None
        self.v: A = None
        self.x: G = None
        self.txt = txt

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

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

d.z = i
d.w = j
d.q = a
j.w = d
j.r = k
j.s = i
j.p = a
a.o = l
i.u = a
i.t = l
i.x = j
i.r = k
i.p = k
i.y = d
l.p = i
k.p = l
k.t = i
k.r = i
k.y = a
k.z = j
k.v = d
k.x = e
e.x = j
assert i.r.y.o.p.r.txt == "k"