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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.w: D = None
        self.x: E = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: B = None
        self.w: D = None
        self.x: E = None
        self.o: B = None
        self.txt = txt

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

h.r = d
l.s = j
l.u = j
l.w = n
l.v = n
d.w = c
n.s = b
n.x = d
e.q = d
e.o = h
e.u = b
c.z = n
b.v = d
b.p = j
b.o = j
b.w = n
b.x = e
f.q = d
f.o = h
f.u = b
j.s = l
j.u = l
j.w = n
j.v = n
assert d.w.z.s.x.u.p.v.s.v.txt == "d"