class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: E = None
        self.p: D = None
        self.t: E = None
        self.v: C = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: A = None
        self.s: A = None
        self.r: G = None
        self.z: B = None
        self.o: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.x: C = None
        self.w: C = None
        self.p: F = None
        self.o: C = None
        self.s: A = None
        self.txt = txt

d = A("d")
n = B("n")
c = C("c")
i = D("i")
e = E("e")
j = F("j")
f = G("f")
g = D("g")
h = E("h")
l = C("l")

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: A = None
        self.s: A = None
        self.r: G = None
        self.z: B = None
        self.o: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.x: C = None
        self.w: C = None
        self.p: F = None
        self.o: C = None
        self.s: A = None
        self.txt = txt

d = A("d")
n = B("n")
c = C("c")
i = D("i")
e = E("e")
j = F("j")
f = G("f")
g = D("g")
h = E("h")
l = C("l")

d.s = l
d.o = l
d.u = e
d.p = i
d.t = h
d.v = c
n.q = j
c.q = f
c.r = f
c.o = f
c.v = d
c.s = d
c.z = n
i.u = n
i.o = j
e.q = d
e.p = c
j.z = g
j.r = e
f.r = d
f.z = d
f.s = d
f.x = l
f.w = l
f.o = l
f.p = j
g.u = n
g.o = j
h.q = d
h.p = c
l.q = f
l.r = f
l.o = f
l.v = d
l.s = d
l.z = n
assert e.q.v.o.p.z.u.q.r.q.txt == "d"