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

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

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

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

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

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

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

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

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

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

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

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

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

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

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