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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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