class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.s: G = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: C = None
        self.q: F = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: H = None
        self.o: A = None
        self.t: B = None
        self.v: A = None
        self.z: B = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: F = None
        self.w: B = None
        self.s: G = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

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

i.t = d
i.u = g
i.s = f
i.x = b
g.p = b
g.x = b
g.z = k
g.q = m
k.s = d
b.q = i
b.r = g
b.x = g
b.v = c
d.u = g
d.t = g
d.z = g
d.s = c
d.o = i
d.v = i
d.r = k
m.v = b
m.p = c
f.w = b
c.t = b
c.x = m
c.w = g
c.u = g
c.s = f
c.r = d
assert k.s.v.s.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.s: G = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: C = None
        self.q: F = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: H = None
        self.o: A = None
        self.t: B = None
        self.v: A = None
        self.z: B = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: F = None
        self.w: B = None
        self.s: G = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

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

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