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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: E = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: E = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.txt = txt

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

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