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

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

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

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

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

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

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

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

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

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

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

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

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

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

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