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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: F = None
        self.y: F = None
        self.s: E = None
        self.r: E = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: F = None
        self.y: F = None
        self.s: E = None
        self.r: E = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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