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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: E = None
        self.z: D = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

n.s = e
n.u = e
n.r = c
n.x = g
b.u = c
b.s = c
b.v = g
b.o = n
c.v = b
c.u = b
c.y = l
c.p = e
c.o = n
c.r = n
l.o = n
l.z = b
g.x = e
g.r = c
g.v = n
e.t = c
e.r = c
e.v = g
e.z = l
e.u = l
assert b.v.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: C = None
        self.u: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: E = None
        self.z: D = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

n.s = e
n.u = e
n.r = c
n.x = g
b.u = c
b.s = c
b.v = g
b.o = n
c.v = b
c.u = b
c.y = l
c.p = e
c.o = n
c.r = n
l.o = n
l.z = b
g.x = e
g.r = c
g.v = n
e.t = c
e.r = c
e.v = g
e.z = l
e.u = l
assert b.v.v.u.txt == "e"