class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: C = None
        self.x: C = None
        self.t: C = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

f = A("f")
a = B("a")
d = C("d")
c = D("c")
j = E("j")
m = F("m")
i = G("i")
g = H("g")

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

f = A("f")
a = B("a")
d = C("d")
c = D("c")
j = E("j")
m = F("m")
i = G("i")
g = H("g")

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