class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: B = None
        self.v: C = None
        self.z: I = None
        self.u: F = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: B = None
        self.v: C = None
        self.z: I = None
        self.u: F = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: C = None
        self.x: B = None
        self.txt = txt

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

i.x = l
m.y = f
l.z = c
b.v = k
b.s = k
b.w = m
b.p = c
c.x = n
c.s = i
c.y = i
j.s = m
j.v = c
f.t = l
f.v = l
f.x = c
f.p = m
f.z = d
f.u = j
f.s = i
k.w = b
d.z = c
d.t = l
d.x = m
n.v = k
n.s = k
n.w = m
n.p = c
assert l.z.x.w.y.t.z.x.w.y.txt == "f"