class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: D = None
        self.y: B = None
        self.t: F = None
        self.r: C = None
        self.w: D = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: B = None
        self.r: F = None
        self.o: A = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.s: A = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: H = None
        self.p: A = None
        self.o: B = None
        self.r: E = None
        self.w: A = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: H = None
        self.q: D = None
        self.o: A = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: D = None
        self.y: B = None
        self.t: F = None
        self.r: C = None
        self.w: D = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: B = None
        self.r: F = None
        self.o: A = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.s: A = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: H = None
        self.p: A = None
        self.o: B = None
        self.r: E = None
        self.w: A = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: H = None
        self.q: D = None
        self.o: A = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.w: G = None
        self.txt = txt

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

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