class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.u: D = None
        self.r: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.z: A = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.z: A = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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