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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: B = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: B = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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