class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

d.p = h
d.q = c
d.x = b
d.v = i
c.w = b
f.s = k
a.p = f
a.s = f
a.x = g
i.r = b
i.u = d
i.s = g
h.p = c
h.q = a
j.v = d
j.q = g
j.t = h
b.p = h
b.q = c
b.x = d
b.v = i
k.v = d
k.q = i
k.t = h
g.r = d
g.u = d
g.s = i
assert c.w.v.s.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

d.p = h
d.q = c
d.x = b
d.v = i
c.w = b
f.s = k
a.p = f
a.s = f
a.x = g
i.r = b
i.u = d
i.s = g
h.p = c
h.q = a
j.v = d
j.q = g
j.t = h
b.p = h
b.q = c
b.x = d
b.v = i
k.v = d
k.q = i
k.t = h
g.r = d
g.u = d
g.s = i
assert c.w.v.s.s.r.txt == "b"