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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: E = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: E = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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