class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.t: G = None
        self.p: A = None
        self.r: D = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: D = None
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.y: A = None
        self.p: D = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.z: E = None
        self.p: D = None
        self.t: E = None
        self.s: B = None
        self.txt = txt

a = A("a")
n = B("n")
f = C("f")
g = D("g")
i = E("i")
b = F("b")
j = G("j")
l = H("l")
d = E("d")

a.t = j
a.s = j
a.u = b
n.s = g
n.r = g
n.x = g
n.w = a
n.p = a
n.z = a
n.t = j
f.z = l
f.r = d
g.u = n
g.w = a
i.y = a
i.r = g
i.o = j
b.r = n
b.u = n
b.t = f
b.s = f
b.z = a
b.o = g
b.x = g
j.x = l
j.r = l
j.y = a
j.p = g
j.v = d
l.r = a
l.w = g
l.p = g
l.z = d
l.t = i
l.s = n
d.y = a
d.r = g
d.o = j
assert a.s.r.t.r.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.t: G = None
        self.p: A = None
        self.r: D = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: D = None
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.y: A = None
        self.p: D = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.z: E = None
        self.p: D = None
        self.t: E = None
        self.s: B = None
        self.txt = txt

a = A("a")
n = B("n")
f = C("f")
g = D("g")
i = E("i")
b = F("b")
j = G("j")
l = H("l")
d = E("d")

a.t = j
a.s = j
a.u = b
n.s = g
n.r = g
n.x = g
n.w = a
n.p = a
n.z = a
n.t = j
f.z = l
f.r = d
g.u = n
g.w = a
i.y = a
i.r = g
i.o = j
b.r = n
b.u = n
b.t = f
b.s = f
b.z = a
b.o = g
b.x = g
j.x = l
j.r = l
j.y = a
j.p = g
j.v = d
l.r = a
l.w = g
l.p = g
l.z = d
l.t = i
l.s = n
d.y = a
d.r = g
d.o = j
assert a.s.r.t.r.u.r.txt == "g"