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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.txt = txt

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

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

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

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