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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.o: C = None
        self.y: G = None
        self.z: G = None
        self.p: D = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.u: C = None
        self.v: D = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: F = None
        self.q: F = None
        self.t: B = None
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.o: C = None
        self.y: G = None
        self.z: G = None
        self.p: D = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.u: C = None
        self.v: D = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: F = None
        self.q: F = None
        self.t: B = None
        self.r: A = None
        self.txt = txt

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

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