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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

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

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

d = A("d")
k = B("k")
n = C("n")
e = D("e")
c = E("c")
a = F("a")
l = G("l")
h = D("h")
f = D("f")
j = E("j")

d.x = c
d.z = a
k.s = n
k.t = a
k.q = d
n.u = a
n.y = a
e.t = k
c.s = a
c.t = f
c.v = k
a.y = j
a.s = n
a.r = d
l.w = n
h.t = k
f.t = k
j.s = a
j.t = e
j.v = k
assert d.z.s.u.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: D = None
        self.v: B = None
        self.txt = txt

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

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

d = A("d")
k = B("k")
n = C("n")
e = D("e")
c = E("c")
a = F("a")
l = G("l")
h = D("h")
f = D("f")
j = E("j")

d.x = c
d.z = a
k.s = n
k.t = a
k.q = d
n.u = a
n.y = a
e.t = k
c.s = a
c.t = f
c.v = k
a.y = j
a.s = n
a.r = d
l.w = n
h.t = k
f.t = k
j.s = a
j.t = e
j.v = k
assert d.z.s.u.s.y.txt == "a"