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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.x: B = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.x: B = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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