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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: E = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: B = None
        self.w: C = None
        self.x: F = None
        self.p: D = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.u: A = None
        self.s: B = None
        self.o: H = None
        self.x: I = None
        self.p: A = None
        self.t: C = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: E = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: B = None
        self.w: C = None
        self.x: F = None
        self.p: D = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: C = None
        self.u: A = None
        self.s: B = None
        self.o: H = None
        self.x: I = None
        self.p: A = None
        self.t: C = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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