class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: G = None
        self.v: C = None
        self.r: F = None
        self.p: A = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: G = None
        self.z: A = None
        self.p: G = None
        self.o: E = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: G = None
        self.v: C = None
        self.r: F = None
        self.p: A = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: G = None
        self.z: A = None
        self.p: G = None
        self.o: E = None
        self.t: A = None
        self.txt = txt

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

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

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