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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: H = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: G = None
        self.y: A = None
        self.r: B = None
        self.q: H = None
        self.t: H = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: H = None
        self.t: G = None
        self.q: H = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: E = None
        self.x: D = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: H = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: G = None
        self.y: A = None
        self.r: B = None
        self.q: H = None
        self.t: H = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: H = None
        self.t: G = None
        self.q: H = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: E = None
        self.x: D = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

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

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