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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: E = None
        self.s: A = None
        self.p: H = None
        self.w: C = None
        self.x: G = None
        self.v: C = None
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: B = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: D = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

l = A("l")
b = B("b")
f = C("f")
c = D("c")
k = E("k")
e = F("e")
m = G("m")
i = H("i")
n = I("n")

l.t = m
b.r = n
b.o = k
b.s = l
b.p = i
b.y = i
b.w = f
b.v = f
b.x = m
f.s = b
f.w = i
f.x = k
f.v = l
f.u = e
c.v = n
c.t = b
c.s = i
k.y = c
k.t = c
k.o = l
k.x = b
k.s = f
e.y = f
e.o = c
e.p = c
m.u = e
i.y = n
n.v = c
assert n.v.v.v.v.v.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: E = None
        self.s: A = None
        self.p: H = None
        self.w: C = None
        self.x: G = None
        self.v: C = None
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: B = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: D = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

l = A("l")
b = B("b")
f = C("f")
c = D("c")
k = E("k")
e = F("e")
m = G("m")
i = H("i")
n = I("n")

l.t = m
b.r = n
b.o = k
b.s = l
b.p = i
b.y = i
b.w = f
b.v = f
b.x = m
f.s = b
f.w = i
f.x = k
f.v = l
f.u = e
c.v = n
c.t = b
c.s = i
k.y = c
k.t = c
k.o = l
k.x = b
k.s = f
e.y = f
e.o = c
e.p = c
m.u = e
i.y = n
n.v = c
assert n.v.v.v.v.v.t.w.txt == "f"