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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.q: F = None
        self.v: B = None
        self.p: F = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.o: E = None
        self.s: E = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.q: F = None
        self.v: B = None
        self.p: F = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.o: E = None
        self.s: E = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

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

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