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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: E = None
        self.v: E = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.w: C = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

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

b = A("b")
n = B("n")
k = C("k")
d = D("d")
g = E("g")
e = C("e")

b.u = d
b.s = d
b.q = n
b.z = e
b.y = e
n.v = e
n.s = e
k.q = n
k.s = g
k.v = g
k.x = d
d.x = g
d.q = e
d.w = e
d.p = e
d.z = b
g.y = k
g.p = e
g.v = b
g.u = b
e.q = n
e.s = g
e.v = g
e.x = d
assert g.y.x.p.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.q: B = None
        self.z: C = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: E = None
        self.v: E = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.w: C = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

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

b = A("b")
n = B("n")
k = C("k")
d = D("d")
g = E("g")
e = C("e")

b.u = d
b.s = d
b.q = n
b.z = e
b.y = e
n.v = e
n.s = e
k.q = n
k.s = g
k.v = g
k.x = d
d.x = g
d.q = e
d.w = e
d.p = e
d.z = b
g.y = k
g.p = e
g.v = b
g.u = b
e.q = n
e.s = g
e.v = g
e.x = d
assert g.y.x.p.x.z.txt == "b"