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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

k.w = h
k.u = e
j.r = a
j.z = a
j.x = k
j.o = i
h.p = c
h.r = m
a.z = j
a.o = k
a.w = h
m.r = i
m.u = c
i.z = k
c.r = i
c.u = m
e.r = a
e.z = a
e.x = k
e.o = i
assert k.u.x.w.p.u.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

k.w = h
k.u = e
j.r = a
j.z = a
j.x = k
j.o = i
h.p = c
h.r = m
a.z = j
a.o = k
a.w = h
m.r = i
m.u = c
i.z = k
c.r = i
c.u = m
e.r = a
e.z = a
e.x = k
e.o = i
assert k.u.x.w.p.u.u.r.txt == "i"