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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.w: D = None
        self.t: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.r: F = None
        self.z: E = None
        self.u: B = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: C = None
        self.o: B = None
        self.s: C = None
        self.v: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.w: D = None
        self.t: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.r: F = None
        self.z: E = None
        self.u: B = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: C = None
        self.o: B = None
        self.s: C = None
        self.v: D = None
        self.q: E = None
        self.txt = txt

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

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