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

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

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

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

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

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

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

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

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

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

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

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

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

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

b.w = j
b.y = j
b.r = a
h.v = n
l.x = b
n.o = m
n.p = j
j.p = l
j.x = a
a.o = m
m.v = n
assert l.x.r.o.v.txt == "n"