class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.w: C = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: G = None
        self.w: B = None
        self.z: G = None
        self.q: A = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: C = None
        self.v: D = None
        self.y: G = None
        self.q: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: G = None
        self.w: B = None
        self.z: G = None
        self.q: A = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: C = None
        self.v: D = None
        self.y: G = None
        self.q: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.txt = txt

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

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