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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.s: A = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

g = A("g")
k = B("k")
f = C("f")
j = D("j")
h = E("h")
b = F("b")
l = G("l")
m = A("m")

g.r = h
g.v = k
g.x = f
g.p = j
g.o = l
g.s = l
g.t = m
k.w = j
k.x = j
k.z = f
f.u = j
f.q = j
f.v = l
j.q = k
j.p = k
j.x = k
j.s = m
j.t = h
h.y = j
h.r = m
h.u = b
h.z = f
b.p = j
b.t = j
l.y = f
m.r = h
m.v = k
m.x = f
m.p = j
m.o = l
m.s = l
m.t = g
assert g.p.s.x.v.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: B = None
        self.x: C = None
        self.p: D = None
        self.o: G = None
        self.t: A = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.s: A = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

g = A("g")
k = B("k")
f = C("f")
j = D("j")
h = E("h")
b = F("b")
l = G("l")
m = A("m")

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