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

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

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

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

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

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

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

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

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

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

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

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

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

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

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