class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: D = None
        self.u: F = None
        self.s: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

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

g.q = f
g.t = k
g.u = a
g.s = j
g.r = e
f.w = d
h.z = a
h.t = f
h.r = k
k.r = f
k.z = f
k.o = f
k.q = j
j.z = f
j.w = a
a.r = k
a.t = d
a.p = j
a.v = h
d.y = a
d.t = h
d.u = f
e.r = f
e.z = f
e.o = f
e.q = j
assert h.z.r.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: D = None
        self.u: F = None
        self.s: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

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

g.q = f
g.t = k
g.u = a
g.s = j
g.r = e
f.w = d
h.z = a
h.t = f
h.r = k
k.r = f
k.z = f
k.o = f
k.q = j
j.z = f
j.w = a
a.r = k
a.t = d
a.p = j
a.v = h
d.y = a
d.t = h
d.u = f
e.r = f
e.z = f
e.o = f
e.q = j
assert h.z.r.z.w.txt == "d"