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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: C = None
        self.y: C = None
        self.o: E = None
        self.q: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: C = None
        self.y: C = None
        self.o: E = None
        self.q: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

h.s = i
h.o = i
c.w = l
c.z = d
c.y = g
c.o = k
c.q = e
c.t = f
g.y = f
g.x = k
g.v = i
g.o = l
g.w = e
i.q = l
k.u = e
l.v = i
f.y = d
f.x = k
f.v = i
f.o = l
f.w = c
e.w = l
e.z = g
e.t = g
e.y = f
e.o = k
e.q = c
d.y = g
d.x = k
d.v = i
d.o = l
d.w = e
assert h.o.q.v.q.v.q.v.q.v.txt == "i"