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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.p: E = None
        self.q: F = None
        self.y: A = None
        self.txt = txt

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

j = A("j")
b = B("b")
l = C("l")
c = D("c")
m = E("m")
h = F("h")
i = E("i")
e = A("e")

j.u = b
j.v = l
b.x = l
b.u = h
l.w = h
c.u = l
c.y = j
m.v = b
m.s = b
m.p = i
m.q = h
m.y = e
h.u = b
h.s = i
i.v = b
i.s = b
i.p = m
i.q = h
i.y = e
e.u = b
e.v = l
assert j.v.w.u.x.w.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.p: E = None
        self.q: F = None
        self.y: A = None
        self.txt = txt

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

j = A("j")
b = B("b")
l = C("l")
c = D("c")
m = E("m")
h = F("h")
i = E("i")
e = A("e")

j.u = b
j.v = l
b.x = l
b.u = h
l.w = h
c.u = l
c.y = j
m.v = b
m.s = b
m.p = i
m.q = h
m.y = e
h.u = b
h.s = i
i.v = b
i.s = b
i.p = m
i.q = h
i.y = e
e.u = b
e.v = l
assert j.v.w.u.x.w.u.x.txt == "l"