class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: C = None
        self.p: C = None
        self.o: F = None
        self.u: A = None
        self.x: A = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: F = None
        self.txt = txt

l = A("l")
g = B("g")
h = C("h")
a = D("a")
m = E("m")
i = F("i")
d = G("d")
j = G("j")

l.y = g
l.s = d
g.q = d
h.v = d
h.q = l
a.t = l
a.s = l
a.r = i
a.z = m
a.x = g
a.u = h
a.p = j
m.v = a
m.t = h
m.p = h
m.w = h
m.o = i
m.u = l
m.x = l
i.v = g
i.r = d
d.x = l
d.z = i
j.x = l
j.z = i
assert d.x.y.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: C = None
        self.p: C = None
        self.o: F = None
        self.u: A = None
        self.x: A = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: F = None
        self.txt = txt

l = A("l")
g = B("g")
h = C("h")
a = D("a")
m = E("m")
i = F("i")
d = G("d")
j = G("j")

l.y = g
l.s = d
g.q = d
h.v = d
h.q = l
a.t = l
a.s = l
a.r = i
a.z = m
a.x = g
a.u = h
a.p = j
m.v = a
m.t = h
m.p = h
m.w = h
m.o = i
m.u = l
m.x = l
i.v = g
i.r = d
d.x = l
d.z = i
j.x = l
j.z = i
assert d.x.y.q.x.txt == "l"