class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: G = None
        self.t: D = None
        self.w: I = None
        self.r: H = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.z: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.t: E = None
        self.s: H = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: G = None
        self.t: D = None
        self.w: I = None
        self.r: H = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.z: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.t: E = None
        self.s: H = None
        self.q: F = None
        self.txt = txt

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

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