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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.t: B = None
        self.x: C = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.t: B = None
        self.x: C = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

a.r = j
i.q = a
i.w = f
e.p = k
e.x = k
e.z = j
e.t = i
e.o = a
h.y = i
h.r = e
h.x = f
h.w = j
c.w = j
c.q = f
j.v = e
j.p = a
j.q = a
j.y = c
j.t = f
f.t = e
f.r = c
b.w = j
b.q = f
k.p = e
k.x = e
k.z = j
k.t = i
k.o = a
assert e.p.t.q.r.t.r.txt == "c"