class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: B = None
        self.x: E = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: D = None
        self.q: G = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.u: F = None
        self.q: A = None
        self.t: E = None
        self.s: F = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.x: D = None
        self.w: C = None
        self.v: F = None
        self.t: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: D = None
        self.q: G = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.u: F = None
        self.q: A = None
        self.t: E = None
        self.s: F = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.x: D = None
        self.w: C = None
        self.v: F = None
        self.t: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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