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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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