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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.r: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: E = None
        self.u: D = None
        self.r: A = None
        self.v: F = None
        self.w: C = None
        self.txt = txt

c = A("c")
a = B("a")
i = C("i")
h = D("h")
f = E("f")
m = F("m")
n = F("n")

c.u = f
a.p = h
a.w = c
a.r = m
i.p = f
i.t = f
h.v = n
f.p = m
f.x = c
f.y = c
m.t = i
m.w = i
m.o = f
m.u = h
m.r = c
m.v = n
n.t = i
n.w = i
n.o = f
n.u = h
n.r = c
n.v = m
assert a.p.v.u.v.v.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.r: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: E = None
        self.u: D = None
        self.r: A = None
        self.v: F = None
        self.w: C = None
        self.txt = txt

c = A("c")
a = B("a")
i = C("i")
h = D("h")
f = E("f")
m = F("m")
n = F("n")

c.u = f
a.p = h
a.w = c
a.r = m
i.p = f
i.t = f
h.v = n
f.p = m
f.x = c
f.y = c
m.t = i
m.w = i
m.o = f
m.u = h
m.r = c
m.v = n
n.t = i
n.w = i
n.o = f
n.u = h
n.r = c
n.v = m
assert a.p.v.u.v.v.v.r.txt == "c"