class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: F = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: A = None
        self.v: F = None
        self.u: A = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.t: F = None
        self.o: B = None
        self.r: F = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: A = None
        self.v: F = None
        self.u: A = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.t: F = None
        self.o: B = None
        self.r: F = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: F = None
        self.txt = txt

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

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