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

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

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

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

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

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

a = A("a")
l = B("l")
d = C("d")
j = D("j")
k = E("k")
m = F("m")
f = B("f")
h = A("h")

a.w = d
a.r = d
a.o = m
l.v = k
l.t = a
d.w = k
d.x = f
d.v = m
j.w = m
j.r = m
j.s = d
k.p = j
k.x = j
k.v = m
k.y = d
k.o = d
k.u = h
m.q = d
m.o = d
m.t = j
m.p = h
f.v = k
f.t = a
h.w = d
h.r = d
h.o = m
assert l.t.o.q.w.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

a = A("a")
l = B("l")
d = C("d")
j = D("j")
k = E("k")
m = F("m")
f = B("f")
h = A("h")

a.w = d
a.r = d
a.o = m
l.v = k
l.t = a
d.w = k
d.x = f
d.v = m
j.w = m
j.r = m
j.s = d
k.p = j
k.x = j
k.v = m
k.y = d
k.o = d
k.u = h
m.q = d
m.o = d
m.t = j
m.p = h
f.v = k
f.t = a
h.w = d
h.r = d
h.o = m
assert l.t.o.q.w.x.s.txt == "d"