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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.o: F = None
        self.w: A = None
        self.v: D = None
        self.u: D = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.y: I = None
        self.o: I = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: C = None
        self.w: H = None
        self.u: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: A = None
        self.s: C = None
        self.x: D = None
        self.w: G = None
        self.p: A = None
        self.z: G = None
        self.r: D = None
        self.u: F = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: G = None
        self.s: B = None
        self.t: D = None
        self.x: F = None
        self.p: B = None
        self.z: D = None
        self.o: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.o: F = None
        self.w: A = None
        self.v: D = None
        self.u: D = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.y: I = None
        self.o: I = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: C = None
        self.w: H = None
        self.u: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: A = None
        self.s: C = None
        self.x: D = None
        self.w: G = None
        self.p: A = None
        self.z: G = None
        self.r: D = None
        self.u: F = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: G = None
        self.s: B = None
        self.t: D = None
        self.x: F = None
        self.p: B = None
        self.z: D = None
        self.o: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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