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

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

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

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

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

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

k = A("k")
h = B("h")
i = C("i")
l = D("l")
d = E("d")
a = F("a")
b = A("b")
f = A("f")
m = A("m")

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

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

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

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

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

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

k = A("k")
h = B("h")
i = C("i")
l = D("l")
d = E("d")
a = F("a")
b = A("b")
f = A("f")
m = A("m")

k.u = f
k.s = i
k.t = a
k.w = h
h.t = m
h.o = i
h.q = i
h.p = i
i.r = b
i.y = a
i.z = m
i.p = l
i.x = h
l.t = h
l.y = a
l.p = i
d.q = l
a.w = d
a.u = i
b.u = k
b.s = i
b.t = a
b.w = h
f.u = m
f.s = i
f.t = a
f.w = h
m.u = f
m.s = i
m.t = a
m.w = h
assert i.r.s.z.txt == "m"