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

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

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

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

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

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

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

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

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

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

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

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

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

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

l.w = g
l.q = h
l.s = e
m.u = e
m.p = c
e.u = b
e.s = a
b.y = g
b.o = a
b.p = i
b.u = d
b.w = e
b.v = l
c.v = e
c.p = h
a.v = l
g.y = b
g.o = a
g.p = e
g.u = l
g.w = i
g.v = d
h.u = i
h.p = c
d.w = g
d.q = m
d.s = e
i.u = b
i.s = a
assert a.v.w.v.w.y.txt == "b"