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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: E = None
        self.v: C = None
        self.r: A = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.txt = txt

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

b = A("b")
k = B("k")
f = C("f")
m = D("m")
a = E("a")
h = F("h")
l = G("l")
n = D("n")
c = B("c")

b.q = m
b.r = h
b.t = a
k.r = m
f.s = h
f.y = h
f.q = h
f.u = b
m.y = l
m.x = a
m.u = a
m.v = f
m.r = b
a.q = f
a.r = c
h.z = k
h.t = a
l.r = f
l.s = k
n.y = l
n.x = a
n.u = a
n.v = f
n.r = b
c.r = m
assert f.u.q.x.q.u.t.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: F = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: E = None
        self.v: C = None
        self.r: A = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.txt = txt

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

b = A("b")
k = B("k")
f = C("f")
m = D("m")
a = E("a")
h = F("h")
l = G("l")
n = D("n")
c = B("c")

b.q = m
b.r = h
b.t = a
k.r = m
f.s = h
f.y = h
f.q = h
f.u = b
m.y = l
m.x = a
m.u = a
m.v = f
m.r = b
a.q = f
a.r = c
h.z = k
h.t = a
l.r = f
l.s = k
n.y = l
n.x = a
n.u = a
n.v = f
n.r = b
c.r = m
assert f.u.q.x.q.u.t.r.r.txt == "m"