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

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

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

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

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

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

d = A("d")
k = B("k")
a = C("a")
g = D("g")
i = E("i")
b = F("b")
l = B("l")
h = A("h")

d.v = k
d.w = a
k.x = a
k.r = a
k.w = l
a.s = i
a.o = d
a.v = b
g.r = k
g.y = k
i.r = k
b.q = k
b.t = a
b.y = l
l.x = a
l.r = a
l.w = k
h.v = k
h.w = a
assert k.w.x.v.y.w.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

d = A("d")
k = B("k")
a = C("a")
g = D("g")
i = E("i")
b = F("b")
l = B("l")
h = A("h")

d.v = k
d.w = a
k.x = a
k.r = a
k.w = l
a.s = i
a.o = d
a.v = b
g.r = k
g.y = k
i.r = k
b.q = k
b.t = a
b.y = l
l.x = a
l.r = a
l.w = k
h.v = k
h.w = a
assert k.w.x.v.y.w.x.s.txt == "i"