class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: I = None
        self.v: B = None
        self.o: F = None
        self.r: G = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

i.z = e
i.u = j
i.p = j
l.p = j
g.t = f
c.w = i
c.z = m
c.v = l
c.o = f
c.u = f
c.r = e
j.p = f
f.y = i
e.q = j
e.p = l
n.x = l
n.v = l
n.y = l
n.w = c
n.q = c
n.r = i
n.p = m
m.q = e
d.r = f
d.t = c
d.q = l
assert f.y.p.p.y.p.p.y.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: I = None
        self.v: B = None
        self.o: F = None
        self.r: G = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

i.z = e
i.u = j
i.p = j
l.p = j
g.t = f
c.w = i
c.z = m
c.v = l
c.o = f
c.u = f
c.r = e
j.p = f
f.y = i
e.q = j
e.p = l
n.x = l
n.v = l
n.y = l
n.w = c
n.q = c
n.r = i
n.p = m
m.q = e
d.r = f
d.t = c
d.q = l
assert f.y.p.p.y.p.p.y.u.p.txt == "f"