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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: G = None
        self.s: F = None
        self.v: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: G = None
        self.p: G = None
        self.y: F = None
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.z: D = None
        self.t: C = None
        self.txt = txt

k = A("k")
h = B("h")
d = C("d")
j = D("j")
m = E("m")
a = F("a")
n = G("n")
i = E("i")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: G = None
        self.s: F = None
        self.v: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: G = None
        self.p: G = None
        self.y: F = None
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.z: D = None
        self.t: C = None
        self.txt = txt

k = A("k")
h = B("h")
d = C("d")
j = D("j")
m = E("m")
a = F("a")
n = G("n")
i = E("i")

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