class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: B = None
        self.o: H = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.u: B = None
        self.r: C = None
        self.v: B = None
        self.x: F = None
        self.s: C = None
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: G = None
        self.w: H = None
        self.y: B = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.o: G = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: C = None
        self.u: F = None
        self.w: A = None
        self.y: C = None
        self.x: D = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.r: D = None
        self.q: G = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

f.u = e
f.q = a
f.o = g
f.z = n
a.y = c
a.r = c
a.s = c
a.t = d
a.u = e
a.v = e
a.x = l
a.o = g
c.q = i
d.o = n
d.u = n
d.w = g
d.y = a
d.q = f
i.s = n
i.p = d
l.x = c
l.v = i
l.o = n
l.z = d
l.r = d
n.o = c
n.v = c
n.y = c
n.u = l
n.w = f
n.x = d
n.t = d
n.s = i
g.s = n
g.q = n
g.p = a
g.r = d
g.y = i
g.v = f
e.y = c
e.r = c
e.s = c
e.t = d
e.u = a
e.v = a
e.x = l
e.o = g
assert g.y.p.q.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: B = None
        self.o: H = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.u: B = None
        self.r: C = None
        self.v: B = None
        self.x: F = None
        self.s: C = None
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: G = None
        self.w: H = None
        self.y: B = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.o: G = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: C = None
        self.u: F = None
        self.w: A = None
        self.y: C = None
        self.x: D = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.r: D = None
        self.q: G = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

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