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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: G = None
        self.t: G = None
        self.w: E = None
        self.r: G = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: I = None
        self.o: G = None
        self.y: B = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: A = None
        self.p: I = None
        self.x: F = None
        self.r: F = None
        self.t: C = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: A = None
        self.z: H = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

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

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

f.x = k
l.s = d
l.o = d
l.x = h
l.t = h
l.r = h
l.w = j
m.p = f
m.s = d
m.o = h
m.y = l
m.t = k
e.q = m
e.t = m
e.w = f
e.p = d
e.x = c
e.r = c
e.v = h
j.u = k
c.o = e
c.u = f
c.z = k
c.w = l
c.y = j
h.x = m
k.p = m
k.z = f
k.t = e
d.o = k
d.u = h
d.w = c
d.v = f
d.q = l
assert l.r.x.y.r.x.p.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: G = None
        self.t: G = None
        self.w: E = None
        self.r: G = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: I = None
        self.o: G = None
        self.y: B = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: A = None
        self.p: I = None
        self.x: F = None
        self.r: F = None
        self.t: C = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: A = None
        self.z: H = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

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

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

f.x = k
l.s = d
l.o = d
l.x = h
l.t = h
l.r = h
l.w = j
m.p = f
m.s = d
m.o = h
m.y = l
m.t = k
e.q = m
e.t = m
e.w = f
e.p = d
e.x = c
e.r = c
e.v = h
j.u = k
c.o = e
c.u = f
c.z = k
c.w = l
c.y = j
h.x = m
k.p = m
k.z = f
k.t = e
d.o = k
d.u = h
d.w = c
d.v = f
d.q = l
assert l.r.x.y.r.x.p.x.z.txt == "f"