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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.x: D = None
        self.r: B = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.x: D = None
        self.r: B = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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