class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.r: F = None
        self.y: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: A = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: A = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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