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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: B = None
        self.p: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.r: C = None
        self.txt = txt

e = A("e")
i = B("i")
c = C("c")
b = D("b")
n = E("n")
d = F("d")
g = E("g")
l = B("l")

e.v = n
e.r = b
i.s = b
i.x = l
i.p = e
c.x = n
c.s = d
c.r = e
c.y = e
b.v = e
b.w = l
n.o = i
n.r = b
n.s = c
n.y = e
d.s = l
d.v = e
d.r = c
g.o = i
g.r = b
g.s = c
g.y = e
l.s = b
l.x = i
l.p = e
assert e.r.w.p.v.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: B = None
        self.p: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.r: C = None
        self.txt = txt

e = A("e")
i = B("i")
c = C("c")
b = D("b")
n = E("n")
d = F("d")
g = E("g")
l = B("l")

e.v = n
e.r = b
i.s = b
i.x = l
i.p = e
c.x = n
c.s = d
c.r = e
c.y = e
b.v = e
b.w = l
n.o = i
n.r = b
n.s = c
n.y = e
d.s = l
d.v = e
d.r = c
g.o = i
g.r = b
g.s = c
g.y = e
l.s = b
l.x = i
l.p = e
assert e.r.w.p.v.y.r.txt == "b"