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

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

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

e = A("e")
l = B("l")
m = C("m")
b = A("b")
n = A("n")
g = A("g")
f = C("f")
j = C("j")
h = B("h")

e.x = h
e.u = h
e.w = l
l.v = f
m.v = e
m.x = l
b.x = h
b.u = h
b.w = l
n.x = l
n.w = l
n.u = h
g.x = h
g.u = h
g.w = l
f.v = b
f.x = h
j.v = n
j.x = l
h.v = f
assert j.x.v.x.v.v.w.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
m = C("m")
b = A("b")
n = A("n")
g = A("g")
f = C("f")
j = C("j")
h = B("h")

e.x = h
e.u = h
e.w = l
l.v = f
m.v = e
m.x = l
b.x = h
b.u = h
b.w = l
n.x = l
n.w = l
n.u = h
g.x = h
g.u = h
g.w = l
f.v = b
f.x = h
j.v = n
j.x = l
h.v = f
assert j.x.v.x.v.v.w.v.v.txt == "b"