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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: B = None
        self.r: A = None
        self.o: F = None
        self.v: A = None
        self.y: A = None
        self.s: A = None
        self.txt = txt

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

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

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

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

h.q = l
h.o = l
h.s = l
h.p = j
e.o = c
e.u = h
l.u = d
l.q = d
l.y = i
d.p = j
d.o = j
d.w = e
d.r = h
d.v = h
d.y = h
d.s = h
i.o = j
j.r = e
c.r = e
f.o = j
assert h.q.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: C = None
        self.p: F = None
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: B = None
        self.r: A = None
        self.o: F = None
        self.v: A = None
        self.y: A = None
        self.s: A = None
        self.txt = txt

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

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

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

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

h.q = l
h.o = l
h.s = l
h.p = j
e.o = c
e.u = h
l.u = d
l.q = d
l.y = i
d.p = j
d.o = j
d.w = e
d.r = h
d.v = h
d.y = h
d.s = h
i.o = j
j.r = e
c.r = e
f.o = j
assert h.q.q.o.txt == "j"