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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: B = None
        self.y: C = None
        self.txt = txt

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

b.s = g
b.z = d
b.p = n
b.y = l
d.r = g
d.w = l
d.z = i
e.r = l
e.v = l
e.o = b
g.s = i
j.p = b
n.q = d
n.v = j
i.r = n
i.x = d
i.y = l
l.r = e
l.v = e
l.o = b
a.p = b
assert j.p.s.s.x.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.p: F = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: B = None
        self.y: C = None
        self.txt = txt

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

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