class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.w: B = None
        self.x: B = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: D = None
        self.x: D = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.w: B = None
        self.x: B = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: D = None
        self.x: D = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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