class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: H = None
        self.s: C = None
        self.x: B = None
        self.w: B = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: H = None
        self.v: E = None
        self.y: E = None
        self.p: B = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: H = None
        self.s: C = None
        self.x: B = None
        self.w: B = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: H = None
        self.v: E = None
        self.y: E = None
        self.p: B = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: C = None
        self.txt = txt

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

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