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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.v: F = None
        self.t: F = None
        self.y: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

l = A("l")
e = B("e")
i = C("i")
f = D("f")
a = E("a")
d = F("d")
g = G("g")
k = H("k")
n = I("n")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.v: F = None
        self.t: F = None
        self.y: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

l = A("l")
e = B("e")
i = C("i")
f = D("f")
a = E("a")
d = F("d")
g = G("g")
k = H("k")
n = I("n")

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