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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: E = None
        self.p: A = None
        self.z: H = None
        self.v: D = None
        self.x: C = None
        self.w: C = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: A = None
        self.r: E = None
        self.q: H = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: B = None
        self.v: A = None
        self.x: B = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: E = None
        self.p: A = None
        self.z: H = None
        self.v: D = None
        self.x: C = None
        self.w: C = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: A = None
        self.r: E = None
        self.q: H = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: B = None
        self.v: A = None
        self.x: B = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

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

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

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

i.w = m
i.q = n
n.t = j
n.z = j
n.u = a
n.o = a
n.p = i
n.v = k
n.x = m
n.w = m
m.u = f
m.t = k
m.r = j
k.u = f
k.t = i
k.r = a
k.v = a
k.q = j
a.t = n
a.y = f
c.o = i
c.v = i
c.w = n
c.x = n
c.y = n
c.t = a
f.u = m
f.w = i
j.r = f
assert m.u.u.t.v.t.t.r.txt == "f"