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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.x: E = None
        self.y: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.x: E = None
        self.y: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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