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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.x: B = None
        self.t: A = None
        self.y: E = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.x: B = None
        self.t: A = None
        self.y: E = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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