class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: B = None
        self.v: D = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.w: C = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.w: C = None
        self.t: B = None
        self.txt = txt

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

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