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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: E = None
        self.s: H = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: F = None
        self.u: B = None
        self.z: A = None
        self.txt = txt

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

m = A("m")
c = B("c")
e = C("e")
n = D("n")
j = E("j")
b = F("b")
i = G("i")
d = H("d")

m.t = b
m.r = j
m.y = j
m.u = e
c.w = i
c.x = i
c.o = n
c.v = n
e.u = i
e.t = j
e.s = d
e.p = n
n.t = m
n.p = d
j.y = c
b.r = i
b.v = c
b.s = d
b.x = e
i.y = c
i.u = c
i.r = b
i.z = m
d.z = c
d.u = b
assert i.u.x.z.t.s.u.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.y: E = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: E = None
        self.s: H = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: F = None
        self.u: B = None
        self.z: A = None
        self.txt = txt

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

m = A("m")
c = B("c")
e = C("e")
n = D("n")
j = E("j")
b = F("b")
i = G("i")
d = H("d")

m.t = b
m.r = j
m.y = j
m.u = e
c.w = i
c.x = i
c.o = n
c.v = n
e.u = i
e.t = j
e.s = d
e.p = n
n.t = m
n.p = d
j.y = c
b.r = i
b.v = c
b.s = d
b.x = e
i.y = c
i.u = c
i.r = b
i.z = m
d.z = c
d.u = b
assert i.u.x.z.t.s.u.x.s.txt == "d"