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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: B = None
        self.s: F = None
        self.w: A = None
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: D = None
        self.r: B = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: B = None
        self.s: F = None
        self.w: A = None
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: D = None
        self.r: B = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

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