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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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