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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: D = None
        self.t: A = None
        self.x: E = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: D = None
        self.t: A = None
        self.x: E = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

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

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