class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.z: A = None
        self.q: A = None
        self.txt = txt

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

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

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

j = A("j")
h = B("h")
i = C("i")
m = D("m")
e = E("e")
b = F("b")
c = G("c")
f = E("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.z: A = None
        self.q: A = None
        self.txt = txt

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

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

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

j = A("j")
h = B("h")
i = C("i")
m = D("m")
e = E("e")
b = F("b")
c = G("c")
f = E("f")

j.s = i
h.x = i
h.t = c
h.q = b
h.w = j
i.p = h
i.v = b
m.p = i
m.t = i
m.z = j
m.q = j
e.q = b
e.r = m
b.o = i
b.x = i
b.w = f
b.s = e
b.v = h
c.u = f
c.x = b
c.t = b
c.w = i
c.o = m
c.q = h
f.q = b
f.r = m
assert c.o.t.p.t.w.txt == "i"