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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: B = None
        self.r: F = None
        self.x: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

i.r = k
i.t = e
i.s = n
i.w = m
k.t = i
k.w = i
d.v = e
d.r = e
d.w = k
d.x = n
d.y = i
g.t = i
g.p = i
g.y = d
g.r = b
g.q = n
g.v = k
g.x = k
m.u = i
m.v = k
m.r = e
m.x = b
e.t = i
e.u = b
e.s = d
e.p = d
b.o = g
b.v = k
b.y = k
n.u = m
assert i.r.w.s.u.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: F = None
        self.s: H = None
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: B = None
        self.r: F = None
        self.x: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

i.r = k
i.t = e
i.s = n
i.w = m
k.t = i
k.w = i
d.v = e
d.r = e
d.w = k
d.x = n
d.y = i
g.t = i
g.p = i
g.y = d
g.r = b
g.q = n
g.v = k
g.x = k
m.u = i
m.v = k
m.r = e
m.x = b
e.t = i
e.u = b
e.s = d
e.p = d
b.o = g
b.v = k
b.y = k
n.u = m
assert i.r.w.s.u.u.r.txt == "k"