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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.s: D = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: C = None
        self.r: C = None
        self.v: C = None
        self.t: C = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
i = C("i")
d = D("d")
a = E("a")
h = F("h")
c = G("c")

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.s: D = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: C = None
        self.r: C = None
        self.v: C = None
        self.t: C = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
i = C("i")
d = D("d")
a = E("a")
h = F("h")
c = G("c")

n.p = a
n.y = c
n.t = i
n.v = i
n.w = j
n.r = d
j.q = a
j.u = i
i.x = a
i.t = a
i.r = a
i.s = d
i.z = d
d.w = i
d.x = i
d.z = n
d.t = n
a.y = d
a.o = i
a.r = i
a.v = i
a.t = i
a.s = i
a.q = i
h.p = i
h.y = n
c.x = j
c.r = j
c.t = i
c.s = i
assert j.u.t.t.z.txt == "d"