class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.r: E = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: A = None
        self.t: B = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.s: F = None
        self.r: E = None
        self.p: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.txt = txt

g = A("g")
h = B("h")
j = C("j")
c = D("c")
k = E("k")
b = F("b")
m = F("m")
l = B("l")
f = C("f")
a = A("a")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: A = None
        self.t: B = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.s: F = None
        self.r: E = None
        self.p: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.txt = txt

g = A("g")
h = B("h")
j = C("j")
c = D("c")
k = E("k")
b = F("b")
m = F("m")
l = B("l")
f = C("f")
a = A("a")

g.u = j
g.z = b
g.r = k
g.t = l
h.q = k
h.z = g
h.t = l
h.w = b
h.v = b
j.x = b
j.s = b
j.u = m
j.r = k
j.p = f
c.q = f
c.t = h
k.o = c
b.z = c
b.q = k
m.z = c
m.q = k
l.q = k
l.z = g
l.t = h
l.w = m
l.v = m
f.x = b
f.s = b
f.u = m
f.r = k
f.p = j
a.u = f
a.z = m
a.r = k
a.t = l
assert k.o.q.p.r.txt == "k"