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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.z: F = None
        self.x: G = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: H = None
        self.x: E = None
        self.w: H = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: A = None
        self.z: E = None
        self.w: H = None
        self.u: A = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.z: F = None
        self.x: G = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: H = None
        self.x: E = None
        self.w: H = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: A = None
        self.z: E = None
        self.w: H = None
        self.u: A = None
        self.q: B = None
        self.txt = txt

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

l.v = d
l.q = n
n.q = k
n.s = k
m.p = d
k.o = n
j.p = d
j.z = d
j.q = n
j.x = c
j.y = l
d.p = c
d.o = f
d.w = f
d.x = j
d.v = k
c.w = d
g.p = c
g.v = l
a.x = f
a.r = l
a.u = l
a.z = j
a.w = g
a.q = n
f.p = c
f.v = l
assert c.w.x.y.txt == "l"