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

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

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

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

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

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

l = A("l")
n = B("n")
k = C("k")
e = D("e")
h = E("h")
b = F("b")

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

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

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

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

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

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

l = A("l")
n = B("n")
k = C("k")
e = D("e")
h = E("h")
b = F("b")

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