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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

f.r = i
f.x = i
f.s = j
f.o = a
f.t = a
f.v = b
b.q = f
b.o = f
b.r = f
b.y = k
b.s = j
b.x = j
h.s = k
h.w = j
j.s = g
j.y = g
j.z = i
g.v = i
g.w = i
d.v = i
a.r = i
k.q = f
k.o = f
k.r = f
k.y = b
k.s = j
k.x = j
i.s = k
i.w = j
assert h.w.s.v.s.x.y.v.txt == "i"