class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.o: B = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: D = None
        self.v: C = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: D = None
        self.v: C = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

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