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

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

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

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

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

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

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

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

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

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

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

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

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

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

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